﻿using System;
using System.Collections.Generic;
using OurSite.Business.Repositories;

namespace OurSite.Business.Category
{
    public class Category : BaseClass
    {
        public virtual Guid ParentId { get; set; }
        public virtual IList<Category> SubCategories { get; set; }

        public virtual Category ParentCategory 
        { 
            get
            {
                ICategoryRepository repository = new CategoryRepository();
                var parent = repository.GetById(ParentId);
                return parent;
            }

        }
    }
}
